import service from '@/utils/request'

export const getRoleList = (page, pagesize = 5) =>
  service({
    url: '/sys/role',
    method: 'get',
    params: {
      page,
      pagesize
    }
  })
/**
 * 新增角色
 * @param {*} data 三个字段
 * @returns 请求
 */
export const addRole = data => service({
  url: '/sys/role',
  method: 'post',
  data
})
/**
 * 删除角色
 *
 */
export const deleteRole = id => service({
  url: `/sys/role/${id}`,
  method: 'delete'
})
/**
 * 更新角色
 * ***/

export function updateRole(data) {
  return service({
    url: `/sys/role/${data.id}`,
    method: 'put',
    data
  })
}
